using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using ConnectSQLServer.Common;

namespace ConnectSQLServer.Controls
{
	/// <summary>
	/// Summary description for Editor.
	/// </summary>
	public class Editor : System.Windows.Forms.UserControl
	{
		public ICSharpCode.TextEditor.TextAreaControl txtEditingArea;
        public InfoDatabase infoDatabase;
		private System.Windows.Forms.Panel panel1;
        public System.Windows.Forms.Label lblType;
        private IContainer components;

		public Editor()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitializeComponent call
						
			//ICSharpCode.TextEditor.Document.HighlightingStrategyFactory obj=new ICSharpCode.TextEditor.Document.HighlightingStrategyFactory();
			this.txtEditingArea.TextAreaPainter.KeyDown+=new KeyEventHandler(TextAreaPainter_KeyDown);	
            
		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{

            this.txtEditingArea = new ICSharpCode.TextEditor.TextAreaControl();
            this.infoDatabase = new InfoDatabase();
            this.panel1 = new System.Windows.Forms.Panel();
            this.lblType = new System.Windows.Forms.Label();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // txtEditingArea
            // 
            this.txtEditingArea.Dock = System.Windows.Forms.DockStyle.Fill;
            this.txtEditingArea.EnableFolding = false;
            this.txtEditingArea.Location = new System.Drawing.Point(0, 24);
            this.txtEditingArea.Name = "txtEditingArea";
            this.txtEditingArea.ScrollMarginHeight = 0;
            this.txtEditingArea.ShowInvalidLines = false;
            this.txtEditingArea.Size = new System.Drawing.Size(464, 248);
            this.txtEditingArea.TabIndex = 0;
            this.txtEditingArea.Load += new System.EventHandler(this.txtEditingArea_Load);
            this.txtEditingArea.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtEditingArea_KeyDown);
            this.txtEditingArea.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtEditingArea_KeyPress);
            // 
            // panel1
            // 
            this.panel1.BackColor = System.Drawing.Color.WhiteSmoke;
            this.panel1.Controls.Add(this.lblType);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(464, 24);
            this.panel1.TabIndex = 1;
            // 
            // lblType
            // 
            this.lblType.AutoSize = true;
            this.lblType.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.lblType.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblType.ForeColor = System.Drawing.SystemColors.InactiveCaption;
            this.lblType.Location = new System.Drawing.Point(176, 0);
            this.lblType.Name = "lblType";
            this.lblType.Size = new System.Drawing.Size(0, 23);
            this.lblType.TabIndex = 0;
            // 
            // Editor
            // 
            this.Controls.Add(this.txtEditingArea);
            this.Controls.Add(this.panel1);
            this.Name = "Editor";
            this.Size = new System.Drawing.Size(464, 272);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.ResumeLayout(false);

		}
		#endregion

		private void txtEditingArea_Load(object sender, System.EventArgs e)
		{
			
		}

		private void txtEditingArea_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			
		}

		private void TextAreaPainter_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
		
			if (e.KeyCode==Keys.Delete)
				MessageBox.Show("helo");
			//new ICSharpCode.TextEditor.Actions.Delete().Execute(txtEditingArea);
		}

		private void txtEditingArea_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			//if (e.KeyCode==Keys.Delete)
				MessageBox.Show("helo");
				//new ICSharpCode.TextEditor.Actions.Delete().Execute(txtEditingArea);
		}
	}
}
